package com.xxzb.pack0720;



import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.util.Scanner;

public class DemoD {
    public static void main(String[] args) throws Exception{
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入要删除的员工编号：");
        int empno=sc.nextInt();
        Class.forName("com.mysql.jdbc.Driver");
        String url="jdbc:mysql:///gaofeng2207?useSSL=false";
        String username="root";
        String password="1234";
        Connection conn= DriverManager.getConnection(url,username,password);
        String sql="delete from gaofeng2207.emp where empno="+empno;
        PreparedStatement ps=conn.prepareStatement(sql);
        ps.executeUpdate();
        ps.close();
        conn.close();
    }
}
